package com.hzdl.springbootdemo.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * @author:Asus
 * @date:2020/2/21
 * @description:
 */
public class UserInfo {
    //忽略 @Json lgnore
    private Integer id;
    private String name;
    private Integer age;
    //日期格式化
    @JsonFormat(pattern = "yyyy/MM/dd hh:mm:ss a",locale = "zh",timezone = "GMT+8")
    private Date sr;

    public UserInfo(Integer id, String name, Date sr) {
        this.id = id;
        this.name = name;
        this.sr = sr;
    }

    public UserInfo(Integer id, String name, Integer age, Date sr) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sr = sr;
    }

    public Integer getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sr=" + sr +
                '}';
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getSr() {
        return sr;
    }

    public void setSr(Date sr) {
        this.sr = sr;
    }

    public UserInfo(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public UserInfo() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
